<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ page import="java.util.*" %>
<%@ page import="java.io.*" %>
<%@ page import="jsp.bean.*" %>
<%@ page import="java.util.Date" %>
<%@ page import="jsp.util.ConnectionContext" %>
<%@ page import="java.sql.*" %> 

<%
request.setCharacterEncoding("utf-8");
%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>회원정보확인</title>
</head>

<body><jsp:useBean id="member" class="jsp.bean.Member" />
<jsp:setProperty name="member" property="*" />
<jsp:setProperty name="member" property="registerDate" value="<%= new Date() %>" />

 <% 
	
try{
		Connection conn = ConnectionContext.getConnection();
		PreparedStatement pstmt = conn.prepareStatement("INSERT INTO member(id,name,passWord,email1,email2,phoneNum1,phoneNum2,phoneNum3,birth1,birth2,birth3,pwdHint,pwdAnswer,registerDate)"+ " values (?,?,?,?,?,?,?,?,?,?,?,?,?,?)");				
		pstmt.setString(1, member.getId());
		pstmt.setString(2, member.getName());
		pstmt.setString(3, member.getpassWord());
		pstmt.setString(4, member.getEmail1());
		pstmt.setString(5, member.getEmail2());
		pstmt.setString(6, member.getPhoneNum1());
		pstmt.setString(7, member.getPhoneNum2());
		pstmt.setString(8, member.getPhoneNum3());
		pstmt.setString(9, member.getBirth1());
		pstmt.setString(10,member.getBirth2());
		pstmt.setString(11,member.getBirth3());
		pstmt.setString(12,member.getPwdHint());
		pstmt.setString(13,member.getPwdAnswer());
		pstmt.setDate(14, new java.sql.Date(member.getRegisterDate().getTime()));
		pstmt.executeUpdate();
	}catch(SQLException ex){
		%>
		에러: <%=ex %>
	<%

		}

	%>
<div id="wrapper" style="border:1px solid #696">
	<jsp:include page="Menubar.jsp" flush="false"/>	
<form  method="post" align="center" action="Main_join_confirm2.jsp">
<table width="400" border="1">
<tr>
    <td>ID</td>
    <td><jsp:getProperty name="member" property="id" /></td>
</tr>
<tr>
    <td>이름</td>
    <td><jsp:getProperty name="member" property="name" /></td>
</tr>
<tr>
    <td>비밀번호</td>
    <td><jsp:getProperty name="member" property="passWord" /></td>
</tr>

<tr>
    <td>email1</td>
    <td><jsp:getProperty name="member" property="email1" /></td>
</tr>
<tr>
    <td>email2</td>
    <td><jsp:getProperty name="member" property="email2" /></td>
</tr>
<tr>
    <td>phoneNum1</td>
    <td><jsp:getProperty name="member" property="phoneNum1" /></td>
</tr>
<tr>
    <td>phoneNum2</td>
    <td><jsp:getProperty name="member" property="phoneNum2" /></td>
</tr>
<tr>
    <td>phoneNum3</td>
    <td><jsp:getProperty name="member" property="phoneNum3" /></td>
</tr>
<tr>
    <td>birth1</td>
    <td><jsp:getProperty name="member" property="birth1" /></td>
</tr>
<tr>
    <td>birth2</td>
    <td><jsp:getProperty name="member" property="birth2" /></td>
</tr>
<tr>
    <td>birth3</td>
    <td><jsp:getProperty name="member" property="birth3" /></td>
</tr>
<tr>
    <td>pwdHint</td>
    <td><jsp:getProperty name="member" property="pwdHint" /></td>
</tr>
<tr>
    <td>pwdAnswer</td>
    <td><jsp:getProperty name="member" property="pwdAnswer" /></td>
</tr>
<tr>
<tr>
    <td>가입일시</td>
    <td><jsp:getProperty name="member" property="registerDate" /></td>
</tr>
<tr>
    <td><input type="submit" value="확인완료"></td>
    <td><input type="button" value="다시쓰기" onClick="history.back()"></td>
</tr>

</table>
</form>
</div>
</body>

</html>